package com.huawei.aiservice.controller;

import com.huawei.aiservice.entity.dto.FeedBackDto;
import com.huawei.aiservice.entity.pojo.FeedBack;
import com.huawei.aiservice.entity.vo.Response;
import com.huawei.aiservice.enums.ControllerConstants;
import com.huawei.aiservice.service.FeedBackService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping(path = "/aiService/feedback", produces = {ControllerConstants.APPLICATION_JSON_PRODUCE},
        consumes = {ControllerConstants.APPLICATION_JSON_CONSUMER})
public class FeedBackController {

    @Resource
    private FeedBackService feedBackService;
    @RequestMapping(value = "/set", produces = {"application/json"}, consumes = {"*/*;charset=UTF-8"},
            method = RequestMethod.POST)
    public Response<String> check(@RequestBody FeedBackDto feedBackDto) {
        return feedBackService.feedBack(feedBackDto);
    }

    @RequestMapping(value = "/get", produces = {"application/json"}, consumes = {"*/*;charset=UTF-8"},
            method = RequestMethod.GET)
    public Response<FeedBack> getFeedBack(@RequestParam("defectId") int defectId) {
        return feedBackService.getFeedBack(defectId);
    }
}
